//
//  BiPurchaseParser.m
//  TrunkIndustryManageSystem
//
//  Created by WT_lyy on 15/4/27.
//  Copyright (c) 2015年 李璐西. All rights reserved.
//

#import "BiPurchaseParser.h"
#import "JSONKit.h"

#import "BiPurchaseCheckEntity.h"
#import "BiPurchaseRefitEntity.h"
#import "BiPurchaseYanshouEntity.h"

#import "BiPurChaseOilTankInfoEntity.h"
#import "BiPurChaseStirMixInfoEntity.h"
#import "BiPurChaseFlatInfoEntity.h"
#import "BiPurChaseCarInfoEntity.h"
#import "BiPurchaseStockEntity.h"
#import "BiPurchaseSupplier.h"
@implementation BiPurchaseParser
SINGLE_INSTANCE_IMPLEMENTION(BiPurchaseParser)

//获取订单审批列表
+ (NSDictionary *)parserCarPurchaseOderCheckListEntity:(NSString*)jsonStr{

    NSMutableArray * array = [NSMutableArray array];
    
    NSDictionary *jsonDict = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    id  data = jsonDict[@"data"];
    
    if ([data isKindOfClass:[NSString class]]||[data isKindOfClass:[NSNull class]]) {
        
    }else if ([data isKindOfClass:[NSArray class]]){
        
        NSArray *dataArr = (NSArray *)data;
        
        if (0 == dataArr.count) {
            
            
        }else{
            
            for (NSInteger i = 0; i < dataArr.count; i++) {
                
                NSDictionary * dataDic = dataArr[i];
                
                BiPurchaseCheckEntity * entity = [[BiPurchaseCheckEntity alloc] init];
                
                entity.createTime = GET_NOT_NULL_STRING(dataDic[@"createTime"]);
                entity.forecastSale = GET_NUM_LONG_VALUE(dataDic[@"forecastSale"]);
                entity.e_id = GET_NOT_NULL_STRING(dataDic[@"id"]);
                entity.purchaseCount = GET_NOT_NULL_STRING(dataDic[@"purchaseCount"]);
                entity.ratifyTime = GET_NOT_NULL_STRING(dataDic[@"ratifyTime"]);
                entity.ratifyUserId = GET_NOT_NULL_STRING(dataDic[@"ratifyUserId"]);
                entity.ratifyUserName = GET_NOT_NULL_STRING(dataDic[@"ratifyUserName"]);
                entity.rejectReason = GET_NOT_NULL_STRING(dataDic[@"rejectReason"]);
                entity.supplierId = GET_NOT_NULL_STRING(dataDic[@"supplierId"]);
                entity.supplierName = GET_NOT_NULL_STRING(dataDic[@"supplierName"]);
                entity.templateId = GET_NOT_NULL_STRING(dataDic[@"templateId"]);
                entity.userId = GET_NOT_NULL_STRING(dataDic[@"userId"]);
                entity.userName = GET_NOT_NULL_STRING(dataDic[@"userName"]);
                
                if ([dataDic[@"carInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseCarInfoEntity * carentity = [[BiPurChaseCarInfoEntity alloc] init];
                    
                    carentity.announcementModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"announcementModel"]);
                    carentity.brand =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"brand"]);
                    carentity.cabModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"cabModel"]);
                    carentity.cabType =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"cabType"]);
                    carentity.carColor =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carColor"]);
                    carentity.carDrive =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carDrive"]);
                    carentity.carSeries =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carSeries"]);
                    carentity.engineModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"engineModel"]);
                    carentity.gearBoxModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"gearBoxModel"]);
                    carentity.e_id =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"id"]);
                    carentity.rearAxle =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"rearAxle"]);
                    carentity.rearAxleRatio =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"rearAxleRatio"]);
                    carentity.wheelBase =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"wheelBase"]);
                    
                    entity.carEntity = carentity;
                }
                if ([dataDic[@"stockInfo"] isKindOfClass:[NSDictionary class]]) {
                   BiPurchaseStockEntity * stockentity = [[BiPurchaseStockEntity alloc] init];
                    
                    stockentity.chassisOffline =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"chassisOffline"]);
                    stockentity.chassisOnline =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"chassisOnline"]);
                    stockentity.dealerNum =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"dealerNum"]);
                    stockentity.nowStorehouse =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"nowStorehouse"]);
                    stockentity.orderApproval =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"orderApproval"]);
                    stockentity.paichanStayOnline =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"paichanStayOnline"]);
                    stockentity.refitOffline =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"refitOffline"]);
                    stockentity.refitOnelie =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"refitOnelie"]);
                    stockentity.refitStayOnline =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"refitStayOnline"]);
                    stockentity.refitting =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"refitting"]);
                    stockentity.storehouseTotal =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"storehouseTotal"]);
                    stockentity.zhongzhuanStorehouse =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"zhongzhuanStorehouse"]);
                    stockentity.zhongzhuanStorehouseStay =  GET_NUM_LONG_VALUE(dataDic[@"stockInfo"][@"zhongzhuanStorehouseStay"]);
                    entity.stockEntity = stockentity;
                }
                
                [array addObject:entity];
            }
        }
    }
    
    return [NSDictionary dictionaryWithObjectsAndKeys:jsonDict[@"response_status"],@"response_status",jsonDict[@"result_info"],@"result_info",array,@"data", nil];
}

//获取改装上线列表
+ (NSDictionary *)parserCarPurchaseOderRefitListEntity:(NSString*)jsonStr{
    
    NSMutableArray * array = [NSMutableArray array];
    
    NSDictionary *jsonDict = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    id  data = jsonDict[@"data"];
    
    if ([data isKindOfClass:[NSString class]]||[data isKindOfClass:[NSNull class]]) {
        
    }else if ([data isKindOfClass:[NSArray class]]){
        
        NSArray *dataArr = (NSArray *)data;
        
        if (0 == dataArr.count) {
            
            
        }else{
            
            for (NSInteger i = 0; i < dataArr.count; i++) {
                
                NSDictionary * dataDic = dataArr[i];
                
                BiPurchaseRefitEntity * entity = [[BiPurchaseRefitEntity alloc] init];
                
                entity.createTime = GET_NOT_NULL_STRING(dataDic[@"createTime"]);
                entity.carId = GET_NOT_NULL_STRING(dataDic[@"carId"]);
                entity.e_id = GET_NOT_NULL_STRING(dataDic[@"id"]);
                entity.manufacturerNum = GET_NOT_NULL_STRING(dataDic[@"manufacturerNum"]);
                entity.orderId = GET_NOT_NULL_STRING(dataDic[@"orderId"]);
                entity.preRefitoutlineTime = GET_NOT_NULL_STRING(dataDic[@"preRefitoutlineTime"]);
                entity.refitOnlineCreateTime = GET_NOT_NULL_STRING(dataDic[@"refitOnlineCreateTime"]);
                entity.refitOnlinePerformance = GET_NOT_NULL_STRING(dataDic[@"refitOnlinePerformance"]);
                entity.refitOnlineSupplierId = GET_NOT_NULL_STRING(dataDic[@"refitOnlineSupplierId"]);
                entity.refitOnlineSupplierName = GET_NOT_NULL_STRING(dataDic[@"refitOnlineSupplierName"]);
                entity.refitOnlineTime = GET_NOT_NULL_STRING(dataDic[@"refitOnlineTime"]);
                entity.refitOnlineUserId = GET_NOT_NULL_STRING(dataDic[@"refitOnlineUserId"]);
                entity.refitOnlineUserName = GET_NOT_NULL_STRING(dataDic[@"refitOnlineUserName"]);
                entity.uprefitId = GET_NOT_NULL_STRING(dataDic[@"uprefitId"]);
                entity.uprefitType = GET_NOT_NULL_STRING(dataDic[@"uprefitType"]);
                entity.imageArr = dataDic[@"contractImages"];
                entity.templateId = GET_NOT_NULL_STRING(dataDic[@"templateId"]);
                
                entity.supplierId = GET_NOT_NULL_STRING(dataDic[@"cotractBean"][@"supplierId"]);
                entity.supplierName = GET_NOT_NULL_STRING(dataDic[@"cotractBean"][@"supplierName"]);
                 entity.systemNumber = GET_NOT_NULL_STRING(dataDic[@"cotractBean"][@"systemNumber"]);
                entity.refitFactoryBeanid = GET_NOT_NULL_STRING(dataDic[@"refitFactoryBean"][@"id"]);
                entity.refitFactoryBeanname = GET_NOT_NULL_STRING(dataDic[@"refitFactoryBean"][@"name"]);
                
                
                
                 BiPurChaseCarInfoEntity * carentity = [[BiPurChaseCarInfoEntity alloc] init];
                if ([dataDic[@"carInfo"] isKindOfClass:[NSDictionary class]]) {
                    carentity.saleStatus =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"saleStatus"]);
                    carentity.vin =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"vin"]);
                    carentity.e_id =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"id"]);
                    carentity.announcementModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"announcementModel"]);
                    carentity.brand =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"brand"]);
                    carentity.cabModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"cabModel"]);
                    carentity.cabType =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"cabType"]);
                    carentity.carColor =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carColor"]);
                    carentity.carDrive =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carDrive"]);
                    carentity.carSeries =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carSeries"]);
                    carentity.categoryId = GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"categoryId"]);
                    carentity.engineModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"engineModel"]);
                    carentity.gearBoxModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"gearBoxModel"]);
                    carentity.rearAxle =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"rearAxle"]);
                    carentity.rearAxleRatio =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"rearAxleRatio"]);
                    carentity.wheelBase =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"wheelbase"]);
                }
                
                entity.carEntity = carentity;
                
                if ([dataDic[@"flatInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseFlatInfoEntity * flatentity = [[BiPurChaseFlatInfoEntity alloc] init];
                    
                    flatentity.e_id = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"id"]);
                    flatentity.flatBoxcolor = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatBoxcolor"]);
                    flatentity.flatBoxtexture = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatBoxtexture"]);
                    flatentity.flatCategory = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatCategory"]);
                    
                    flatentity.flatCisternRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatCisternRequires"]);
                    flatentity.flatHeight = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatHeight"]);
                    flatentity.flatLength = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatLength"]);
                    flatentity.flatWidth = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatWidth"]);
                    
                    flatentity.flatFloorRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatFloorRequires"]);
                    flatentity.flatPosternRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatPosternRequires"]);
                    flatentity.flatSideRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatSideRequires"]);
                    flatentity.flatSpecialRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatSpecialRequires"]);
                    flatentity.flatBreastBoard = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatBreastBoard"]);

                    entity.flatEntity = flatentity;
                }
                if ([dataDic[@"stirMixInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseStirMixInfoEntity * stirentity = [[BiPurChaseStirMixInfoEntity alloc] init];
                    
                    stirentity.mixerCisternRequires = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerCisternRequires"]);
                    stirentity.mixerAirbrand = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerAirbrand"]);
                    stirentity.mixerAirstandard = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerAirstandard"]);
                    stirentity.mixerFillerquantity = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerFillerquantity"]);
                    
                    stirentity.e_id = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"e_id"]);
                    stirentity.mixerHydname = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerHydname"]);
                    stirentity.mixerHydstandard = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerHydstandard"]);
                    stirentity.mixerSpecialRequires = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerSpecialRequires"]);
                    
                    stirentity.mixerTexture = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerTexture"]);
                    stirentity.mixerVolume = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerVolume"]);
                    
                    entity.stinEntity = stirentity;
                }
                if ([dataDic[@"oilTankInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseOilTankInfoEntity * oilentity = [[BiPurChaseOilTankInfoEntity alloc] init];
                    
                    oilentity.tankerBrand = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerBrand"]);
                    oilentity.tankerStandard = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerStandard"]);
                    oilentity.tankerSpecialRequires = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerSpecialRequires"]);
                    oilentity.tankerRefuelname = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerRefuelname"]);
                    
                    oilentity.tankerRefuelstandard = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerRefuelstandard"]);
                    oilentity.tankerNum = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerNum"]);
                    oilentity.tankerQuantity = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerQuantity"]);
                    oilentity.tankerTexture = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerTexture"]);
                    
                    oilentity.e_id = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"id"]);
                    
                    entity.oilEntity = oilentity;
                }
                
                [array addObject:entity];
            }
        }
    }
    
    return [NSDictionary dictionaryWithObjectsAndKeys:jsonDict[@"response_status"],@"response_status",jsonDict[@"result_info"],@"result_info",array,@"data", nil];
}

//获取验收入库列表
+ (NSDictionary *)parserCarPurchaseOderYanshouListEntity:(NSString*)jsonStr{
    
    NSMutableArray * array = [NSMutableArray array];
    
    NSDictionary *jsonDict = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    id  data = jsonDict[@"data"];
    
    if ([data isKindOfClass:[NSString class]]||[data isKindOfClass:[NSNull class]]) {
        
    }else if ([data isKindOfClass:[NSArray class]]){
        
        NSArray *dataArr = (NSArray *)data;
        
        if (0 == dataArr.count) {
            
            
        }else{
            
            for (NSInteger i = 0; i < dataArr.count; i++) {
                
                NSDictionary * dataDic = dataArr[i];
                
                BiPurchaseYanshouEntity * entity = [[BiPurchaseYanshouEntity alloc] init];
                
                entity.createTime = GET_NOT_NULL_STRING(dataDic[@"createTime"]);
                entity.storeRoomNames = dataDic[@"storeRoomNames"];
                entity.checkRukuUserId = GET_NOT_NULL_STRING(dataDic[@"checkRukuUserId"]);
                entity.checkRukuUserName = GET_NOT_NULL_STRING(dataDic[@"checkRukuUserName"]);
                
                if ([dataDic[@"CarPurchaseUprefit"] isKindOfClass:[NSDictionary class]]) {
                    entity.uprefitType = GET_NOT_NULL_STRING(dataDic[@"CarPurchaseUprefit"][@"uprefitType"]);
                }
                entity.checkRukuPerformance = GET_NOT_NULL_STRING(dataDic[@"checkRukuPerformance"]);
                entity.systemNumber = GET_NOT_NULL_STRING(dataDic[@"systemNumber"]);
                entity.manufacturerNum = GET_NOT_NULL_STRING(dataDic[@"manufacturerNum"]);
                entity.photos = dataDic[@"photos"];
                
                entity.uprefitId = GET_NOT_NULL_STRING(dataDic[@"uprefitId"]);
                entity.orderId = GET_NOT_NULL_STRING(dataDic[@"orderId"]);
                entity.carId = GET_NOT_NULL_STRING(dataDic[@"carId"]);
                entity.CarPurchaseUprefit = GET_NOT_NULL_STRING(dataDic[@"CarPurchaseUprefit"]);
                entity.e_id = GET_NOT_NULL_STRING(dataDic[@"id"]);
                
                entity.templateId = GET_NOT_NULL_STRING(dataDic[@"templateId"]);
                
                BiPurChaseCarInfoEntity * carentity = [[BiPurChaseCarInfoEntity alloc] init];
                if ([dataDic[@"carInfo"] isKindOfClass:[NSDictionary class]]) {
                    carentity.saleStatus =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"saleStatus"]);
                    carentity.vin =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"vin"]);
                    carentity.e_id =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"id"]);
                    carentity.parkAddress =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"parkAddress"]);
                    carentity.storeRoomName = GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"storeRoomName"]);
                    carentity.storeRoomId = GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"storeRoomId"]);
                    
                    carentity.announcementModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"announcementModel"]);
                    carentity.brand =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"brand"]);
                    carentity.cabModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"cabModel"]);
                    carentity.cabType =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"cabType"]);
                    carentity.carColor =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carColor"]);
                    carentity.carDrive =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carDrive"]);
                    carentity.carSeries =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"carSeries"]);
                    carentity.categoryId = GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"categoryId"]);
                    carentity.engineModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"engineModel"]);
                    carentity.gearBoxModel =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"gearBoxModel"]);
                    carentity.rearAxle =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"rearAxle"]);
                    carentity.rearAxleRatio =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"rearAxleRatio"]);
                    carentity.wheelBase =  GET_NOT_NULL_STRING(dataDic[@"carInfo"][@"wheelbase"]);
                }
                

                entity.carEntity = carentity;
                
                if ([dataDic[@"flatInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseFlatInfoEntity * flatentity = [[BiPurChaseFlatInfoEntity alloc] init];
                    
                    flatentity.e_id = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"id"]);
                    flatentity.flatBoxcolor = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatBoxcolor"]);
                    flatentity.flatBoxtexture = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatBoxtexture"]);
                    flatentity.flatCategory = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatCategory"]);
                    
                    flatentity.flatCisternRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatCisternRequires"]);
                    flatentity.flatHeight = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatHeight"]);
                    flatentity.flatLength = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatLength"]);
                    flatentity.flatWidth = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatWidth"]);
                    
                    flatentity.flatFloorRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatFloorRequires"]);
                    flatentity.flatPosternRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatPosternRequires"]);
                    flatentity.flatSideRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatSideRequires"]);
                    flatentity.flatSpecialRequires = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatSpecialRequires"]);
                    flatentity.flatBreastBoard = GET_NOT_NULL_STRING(dataDic[@"flatInfo"][@"flatBreastBoard"]);
                    
                    entity.flatEntity = flatentity;
                }
                if ([dataDic[@"stirMixInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseStirMixInfoEntity * stirentity = [[BiPurChaseStirMixInfoEntity alloc] init];
                    
                    stirentity.mixerCisternRequires = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerCisternRequires"]);
                    stirentity.mixerAirbrand = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerAirbrand"]);
                    stirentity.mixerAirstandard = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerAirstandard"]);
                    stirentity.mixerFillerquantity = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerFillerquantity"]);
                    
                    stirentity.e_id = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"e_id"]);
                    stirentity.mixerHydname = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerHydname"]);
                    stirentity.mixerHydstandard = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerHydstandard"]);
                    stirentity.mixerSpecialRequires = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerSpecialRequires"]);
                    
                    stirentity.mixerTexture = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerTexture"]);
                    stirentity.mixerVolume = GET_NOT_NULL_STRING(dataDic[@"stirMixInfo"][@"mixerVolume"]);
                    
                    entity.stinEntity = stirentity;
                }
                if ([dataDic[@"oilTankInfo"] isKindOfClass:[NSDictionary class]]) {
                    BiPurChaseOilTankInfoEntity * oilentity = [[BiPurChaseOilTankInfoEntity alloc] init];
                    
                    oilentity.tankerBrand = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerBrand"]);
                    oilentity.tankerStandard = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerStandard"]);
                    oilentity.tankerSpecialRequires = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerSpecialRequires"]);
                    oilentity.tankerRefuelname = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerRefuelname"]);
                    
                    oilentity.tankerRefuelstandard = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerRefuelstandard"]);
                    oilentity.tankerNum = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerNum"]);
                    oilentity.tankerQuantity = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerQuantity"]);
                    oilentity.tankerTexture = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"tankerTexture"]);
                    
                    oilentity.e_id = GET_NOT_NULL_STRING(dataDic[@"oilTankInfo"][@"id"]);
                    
                    entity.oilEntity = oilentity;
                }
                
                [array addObject:entity];
                
            }
        }
    }
    
    return [NSDictionary dictionaryWithObjectsAndKeys:jsonDict[@"response_status"],@"response_status",jsonDict[@"result_info"],@"result_info",array,@"data", nil];
}

//获取订单审核
+ (NSDictionary *)parserCarPurchaseCommonEntity:(NSString*)jsonStr{

    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:jsonDic];
    
    return dict;
}

//获取改装厂列表
+ (NSDictionary *)parserCarPurchaseSppliserListEntity:(NSString*)jsonStr{
    
    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    id  data = jsonDic[@"data"];
    
    if ([data isKindOfClass:[NSArray class]]) {
        
        
    }
    
    return jsonDic;
}

//获取供应商列表
+ (NSDictionary *)parserCarPurchaseContractListEntity:(NSString*)jsonStr{
    
    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    NSMutableArray * dataArr = [NSMutableArray array];
    
    id  data = jsonDic[@"data"];
    
    if ([data isKindOfClass:[NSArray class]]) {
        
        NSArray * Array = (NSArray *)data;
        
        for (int i = 0;i<Array.count;i++) {
            BiPurchaseSupplier * supentity = [[BiPurchaseSupplier alloc] init];
            NSDictionary * dataDic = Array[i];
            
            supentity.e_id = GET_NOT_NULL_STRING(dataDic[@"id"]);
            supentity.supplierId = GET_NOT_NULL_STRING(dataDic[@"supplierId"]);
            supentity.supplierName = GET_NOT_NULL_STRING(dataDic[@"supplierName"]);
            supentity.systemNumber = GET_NOT_NULL_STRING(dataDic[@"systemNumber"]);
            supentity.uprefitMoney = GET_NOT_NULL_STRING(dataDic[@"uprefitMoney"]);
            supentity.preDoneTime = GET_NOT_NULL_STRING(dataDic[@"preDoneTime"]);
            
            [dataArr addObject:supentity];
        }
    }
    
    return [NSDictionary dictionaryWithObjectsAndKeys:jsonDic[@"response_status"],@"response_status",jsonDic[@"result_info"],@"result_info",dataArr,@"data", nil];
}

+ (NSDictionary *)parserCarPurchaseStoreRoomListEntity:(NSString*)jsonStr{

    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
//    NSMutableArray * dataArr = [NSMutableArray array];
//    
//    id  data = jsonDic[@"data"];
//    
//    if ([data isKindOfClass:[NSArray class]]) {}
//    
//    return dataArr;
    
    return jsonDic;
}

@end
